/*
 * ItemRoutingTypeResource.h
 *
 *  Created on: 2014. 3. 4.
 *      Author: mega
 */

#ifndef ITEMROUTINGTYPERESOURCE_H_
#define ITEMROUTINGTYPERESOURCE_H_

#include <map>

namespace ProjectZ { namespace NResource {

class ItemRoutingTypeResource
{
public:
	struct Key
	{
		Key() : sheetType(0), classType(0) {}
		Key(int rSheetType, int rClassType) : sheetType(rSheetType), classType(rClassType) {}

		int sheetType;
		int classType;

		bool operator == (const Key & rSide) const
		{
			if (this->sheetType == rSide.sheetType && this->classType == rSide.classType)
				return true;

			return false;
		}

		bool operator < (const Key & rSide) const
		{
			if (this->sheetType < rSide.sheetType)
			{
				return true;
			}
			else if (this->sheetType == rSide.sheetType)
			{
				if (this->classType < rSide.classType)
					return true;
			}

			return false;
		}
	};

public:
	struct Flyweight
	{
		int _SHEET_TYPE;
		int _CLASS_TYPE;
		int _EFFECT_COUNT;
		int _EFFECT_TYPE1;
		int _EFFECT_TYPE2;
		int _EFFECT_TYPE3;
		int _EFFECT_TYPE4;
		int _EFFECT_TYPE5;
		int _EFFECT_TYPE6;
		int _EFFECT_TYPE7;
		int _EFFECT_TYPE8;
		int _EFFECT_TYPE9;
		int _EFFECT_TYPE10;
	};

public:
	ItemRoutingTypeResource();
	virtual ~ItemRoutingTypeResource();

	bool		LoadResource();
	Flyweight *	GetFly(Key & clsKey);

private:
	void		Clear();

public:
	typedef std::map<Key, Flyweight *> ITEMROUTINGTYPETREE;

private:
	ITEMROUTINGTYPETREE clsFlyTree;

};

} /*NResource*/ } /*ProjectZ*/


#endif /* ITEMROUTINGTYPERESOURCE_H_ */
